package com.cheung.leetcode.day;

import org.junit.jupiter.api.Test;

/**
 * @BelongsProject : java-leetcode
 * @BelongsPackage : com.cheung.leetcode.day
 * @Author :  cheungming
 * @CreateTime : 2024-06-29 10:12:47
 * @Description : 每日 一题
 * @Version : 1.0
 */
public class Code2710Test {

    public String removeTrailingZeros(String num) {
        int len = num.length();
        while (len > 0 && num.charAt(len - 1) == '0') {
            len--;
        }
        return num.substring(0, len);
    }

    @Test
    public void test1() {
        assert removeTrailingZeros("51230100").equals("512301");
    }

    @Test
    public void test2() {
        assert removeTrailingZeros("123").equals("123");
    }
}
